package com.yoomiito.app.adapter.my;

import androidx.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yoomiito.app.R;
import com.yoomiito.app.model.my.FunctionBean;

import java.util.List;

public class MyFunctionAdapter extends BaseQuickAdapter<FunctionBean, BaseViewHolder> {
    private List<FunctionBean> data;
    public MyFunctionAdapter(@Nullable List<FunctionBean> data) {
        super(R.layout.item_my_function, data);
        this.data = data;
    }

    @Override
    protected void convert(final BaseViewHolder helper, FunctionBean item) {
        ((TextView)helper.getView(R.id.tv_title)).setText(item.getTitle());
        ((ImageView)helper.getView(R.id.iv_icon)).setImageResource(item.getResId());
        helper.setVisible(R.id.icon_new,item.isShowNew());
    }
}
